package com.itheima.cases;

public class TextDemo1 {
    public static void main(String[] args) {
        double sum = Count(100,11,"头等舱");
        System.out.println("优惠价为："+sum);
    }
    public static double Count(double money,int month,String type){
        //判断当前月份是淡季还是旺季
        if (month >= 5 && month <= 10) {
            //旺季
            switch (type){
                case "头等舱":
                    money *= 0.9;
                    break;
                case "经济舱":
                    money *= 0.85;
                    break;
            }
        } else {
            //淡季
            switch (type){
                case "头等舱":
                    money *= 0.7;
                    break;
                case "经济舱":
                    money *= 0.65;
                    break;
            }
        }
        return money;
    }
}
